home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
COMM
/
ANSI_133
/
DEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-06-14
|
2KB
|
63 lines
Program Demo;
Uses TpCrt, PingAnsi, Musica;
Var
f : File;
buffer, b : Array[0..$3fff] Of Char;
i, j : Word;
Ch : Char;
Timer : LongInt Absolute 0 : $46c;
t1, t2, t3, t4 : LongInt;
aa, bb, cc, c1, dd, ee, ff : String[80];
Begin
aa := 'o3D..o2GABo3CD..o2Gp8Gp8';
bb := 'o3E..CDEF#G..o2Gp8Gp8';
cc := 'o3C..DCo2BAB..o3Co2BAGF#..GABGBA...p4';
c1 := 'o3C..DCo2BAB..o3Co2BAGF#..GABGA....p4';
dd := 'o3C..DCo2BAB..o3Co2BAGA..BAGF#G....p4';
ee := 'mlo3B..GABGA..DEF#DG..EF#GDC#..o2Bo3C#o2Ap8ABo3C#DEF#G..' +
'F#..E..F#..o2A..o3C#..D....p4mn';
ff := 'D..o2GF#Gp8o3E..o2GF#Gp8o3D..C..o2B..AGF#GAp8DEF#GABo3C..' +
'o2B..A..Bo3Do2G..F#..G....p4';
Assign(f, 'shuttle2.ans');
SetTextBuf(Ansi, b);
Reset(f, 1);
BlockRead(f, buffer, SizeOf(buffer), j);
Close(f);
TextAttr := 7;
ClrScr;
If GrabTimer then {};
Write(Ansi, #27'[1;33mThis '#27'[32mis '#27, '[ma '#27'[42mTest ');
WriteLn(Ansi,#27'[0m');
PLAY ('mbmnt150l8');
PLAY (aa); PLAY (bb);
t1 := Timer;
For i := 0 To j - 1 Do Write(Ansi, buffer[i]);
t2 := Timer;
PLAY (C1); PLAY (aa);
t3 := Timer;
For i := 0 To j - 1 Do AnsiWrite(buffer[i]);
t4 := Timer;
Write(Ansi,#27,'[0;1mWaiting for background buffer to empty');
While not PlayBufferEmpty do {};
ReleaseTimer;
PurgePlayBuffer;
Write(Ansi, #27'[0m'#27'[2J');
Writeln(Ansi,#27'[1mJ.S.Bach'#27'[30;5m from '#27'[0;1;31m''Little notebook for Anna Magdalena''');
PLAY ('mf'+bb);
WriteLn(Ansi, #27'[0mTime for Write(Ansi,Ch): ', t2 - t1:8, ' tics ');
PLAY (DD);
WriteLn(Ansi, 'Time for AnsiWrite(CH): ', t4 - t3:8, ' tics');
PLAY (aa);PLAY (bb);PLAY (CC);
PLAY (aa);PLAY (bb);PLAY (dd);
PLAY (EE);PLAY (FF);
PLAY (aa);PLAY (bb);PLAY (C1);
PLAY (aa);PLAY (bb);
PLAY (copy(DD, 1, length(dd)-2) + '. ');
WriteLn(Ansi);
NoSound;
End.